package com.example.ssm.service.impl;

import com.example.ssm.dao.DaoFactory;
import com.example.ssm.dao.billDao;
import com.example.ssm.entity.Bill;
import com.example.ssm.entity.Merchant;
import com.example.ssm.entity.User;
import com.example.ssm.service.BillService;
import org.springframework.stereotype.Service;


import java.io.IOException;
import java.util.List;

@Service("billService")
public class BillServiceImpl implements BillService {

    @Override
    public boolean insertBill(Bill bill) throws IOException {
        billDao dao=DaoFactory.getbillDao();
        return dao.insertBill(bill);
    }

    @Override
    public List<Bill> selectNoPayByUserName(User user) throws IOException {
        billDao dao=DaoFactory.getbillDao();
        return dao.selectNoPayByUserName(user);
    }
    @Override
    public List<Bill> selectPayByUserName(User user) throws IOException {
        billDao dao=DaoFactory.getbillDao();
        return dao.selectPayByUserName(user);
    }

    @Override
    public boolean delNoPayById(Bill bill) throws IOException {
        billDao dao=DaoFactory.getbillDao();

        return dao.delNoPayById(bill);
    }

    @Override
    public boolean updateBill(User user) throws IOException {
        billDao dao=DaoFactory.getbillDao();

        return dao.updateBill(user);
    }

    @Override
    public List<Bill> selectNoPayByshop_name(Merchant merchant) throws IOException {
        billDao dao=DaoFactory.getbillDao();

        return dao.selectNoPayByshop_name(merchant);
    }

    @Override
    public List<Bill> selectPayByshop_name(Merchant merchant) throws IOException {
        billDao dao=DaoFactory.getbillDao();

        return dao.selectPayByshop_name(merchant);
    }




}

